/*
 * Copyright 2002-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.beans.factory.config;

import java.util.Iterator;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.lang.Nullable;

/**
 * ConfigurableListableBeanFactory继承了ListableBeanFactory,
 * AutowireCapableBeanFactory, ConfigurableBeanFactory。
 * 在ConfigurableBeanFactory的基础上，它还提供了分析和修改bean定义以及预实例化单例的工具
 * <p>
 * 作者：大军
 *
 * @author Juergen Hoeller
 * @see org.springframework.context.support.AbstractApplicationContext#getBeanFactory()
 * @since 03.11.2003
 */
public interface ConfigurableListableBeanFactory
		extends ListableBeanFactory, AutowireCapableBeanFactory, ConfigurableBeanFactory {

	/**
	 * 在装配的时候忽略指定的依赖类型
	 */
	void ignoreDependencyType(Class<?> type);

	/**
	 * 在装配的时候忽略指定的接口
	 */
	void ignoreDependencyInterface(Class<?> ifc);

	/**
	 * 注册可解析的依赖
	 */
	void registerResolvableDependency(Class<?> dependencyType, @Nullable Object autowiredValue);

	/**
	 * 指定的bean是否可以作为自动装配的候选
	 */
	boolean isAutowireCandidate(String beanName, DependencyDescriptor descriptor)
			throws NoSuchBeanDefinitionException;

	/**
	 * 根据bean名称获取BeanDefinition
	 */
	BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException;

	/**
	 * 获取bean名称的Iterator
	 */
	Iterator<String> getBeanNamesIterator( );

	/**
	 * 清楚bean元数据缓存
	 */
	void clearMetadataCache( );

	/**
	 * 冻结所有bean定义，表明注册的bean定义将不再修改或后期处理。
	 */
	void freezeConfiguration( );

	/**
	 * bean的定义是否被冻结
	 */
	boolean isConfigurationFrozen( );

	/**
	 * 非延迟加载的bean都实例化
	 */
	void preInstantiateSingletons( ) throws BeansException;

}
